// -*-C++-*-
#ifndef __ABSTRACT_SOCKET_H__
# define __ABSTRACT_SOCKET_H__

# include "Impl/ISocket.h"
# include "Impl/SocketImpl.h"

class Socket : public ISocket
{
public:
    Socket();
    virtual ~Socket();

    Socket(Socket const & sock);
    Socket& operator=(Socket const & sock);

    virtual void open(int domain, int type);

    virtual void bind(int port, char *addr);
    virtual void listen(int backlog);
    virtual void accept(ISocket *);

    virtual void connect(int port, char *addr);
    
    virtual int send(const void *msg, size_t len);
    virtual int recv(void *buf, size_t len);

    virtual void close();
private:
    SocketImpl _impl;
};

#endif // __ABSTRACT_SOCKET_H__
